﻿using System;

namespace Sixeyed.CodeGeneration.Attributes
{
    /// <summary>
    /// Attribute specifying the template configuration for a generated item
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=false)]
    public sealed class GeneratedCodeTemplateAttribute : Attribute
    {
        private string _templatePath;
        private string _targetNamespace;
        private string _className;
        private string _fileName;
        
        /// <summary>
        /// Path to T4 template
        /// </summary>
        public string TemplatePath
        {
            get { return this._templatePath; }
        }

        /// <summary>
        /// Target namespace for generated type
        /// </summary>
        public string TargetNamespace
        {
            get { return this._targetNamespace; }
        }

        /// <summary>
        /// Type name for generated item
        /// </summary>
        public string ClassName
        {
            get { return this._className; }
        }

        /// <summary>
        /// Name of generated file
        /// </summary>
        public string FileName
        {
            get { return this._fileName; }
        }

        /// <summary>
        /// Constructor with known state
        /// </summary>
        /// <param name="templatePath">Path to T4 template</param>
        /// <param name="targetNamespace">Target namespace for generated type</param>
        /// <param name="className">Type name for generated item</param>
        /// <param name="fileName">Name of generated file</param>
        public GeneratedCodeTemplateAttribute(string templatePath, string targetNamespace, string className, string fileName)
        {
            this._templatePath = templatePath;
            this._targetNamespace = targetNamespace;
            this._className = className;
            this._fileName = fileName;
        }
    }
}
